from django.shortcuts import render

import logging
import traceback
from .serializers import *
from rest_framework.response import Response
from rest_framework.views import APIView

class datac(APIView):
    """
    post:
        好友列表详情
    get:
        单人获取详情
    """

    def get(self, request):
        # try:
        canshu = request.GET
        da=CanData.objects.get(type=canshu['type'])
        data=CanDataSerializers(da).data
        res_data = {'status': 'ok', 'message': '查询成功！', 'data': data}
        # except:
        #     res_data = {'status': 'error', 'message': '参数错误！'}

        return Response(res_data)
